package com.bawei.park2211a.fg.home

import androidx.lifecycle.MutableLiveData
import com.bawei.base.bean.DepartmentEntity
import com.bawei.base.bean.DepartmentPersonNumberEntity
import com.bawei.base.bean.NoticeEntity
import com.bawei.base.mvvm.BaseViewModel
import com.bawei.base.net.ApiService

import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject
@HiltViewModel
class HomeViewModel @Inject constructor(var apiService: ApiService):BaseViewModel() {
    var noticrSuccess=MutableLiveData<MutableList<NoticeEntity>>()
    var departmentSuccess=MutableLiveData<MutableList<DepartmentEntity>>()
    var departmentPersonNumberSuccess=MutableLiveData<MutableList<DepartmentPersonNumberEntity>>()
     fun notice( page:Int,size:Int){
         httpRequest({apiService.notice(page,size)},{noticrSuccess.postValue(it)})
     }
    fun departmentList(){
        httpRequest({apiService.departmentList()},{departmentSuccess.postValue(it)})
    }
    fun departmentPersonNumber(id:Int){
        httpRequest({apiService.departmentPersonNumber(id)},{departmentPersonNumberSuccess.postValue(it)})
    }
}